package zhongbo.java.air.ingestion.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * 说明：
 *
 * @author 钟波dellNotebook
 * @since 2025年04月07日 星期一 02:31:41
 */
@Component
@Slf4j
public class RedisPathPublisher {

    public static String INGEST_NAME_OF_CHANEL = "ingest_flight_path_chanel_zhongbo";

    @Autowired
    private RedisTemplate<String, String> redisTemplate;

    /**
     * 发送航迹信息到redis频道
     *
     * @param message 消息内容
     */
    public void sendMessage(String message) {
        log.info("发送航迹信息:" + message);
        redisTemplate.convertAndSend(INGEST_NAME_OF_CHANEL, message);
    }
}
